package Singleton;

import java.io.Serializable;

// 懒汉式3
public class Singleton5 implements Serializable {
    private Singleton5(){
        System.out.println("private Singleton5()");
    }

    private static class Holder{
        static final Singleton5 INSTANCE = new Singleton5();
    }

    public static Singleton5 getInstance(){
        return Holder.INSTANCE;
    }

    public static void otherMethod(){
        System.out.println("otherMethod()");
    }
}
